<?=$this->load->view('include_header',null)?>
<style type="text/css">
form#form textarea {
    height: 50px;
    overflow: auto;
    padding: 5px;
    width: 410px;
}
</style>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/ve_update/'.$cateid)?>">

	<h3>委内瑞拉申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
	    <tr class="even">
            <td colspan="5">DATOS PERSONALES / Personal Information:</td>
        </tr>
        <tr class="odd">
            <td>1.	APELLIDOS/Surname</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>2.	NOMBRES/Given Name</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="even">
            <td>3.	NACIONALIDAD/Nationality</td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
            <td>&nbsp;</td>
            <td>4.	SEXO/Sex</td>
            <td>
			<input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />MASCULINO / Male 
            <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />FEMENINO / Female</td>
        </tr>
        <tr class="odd">
            <td>5.	ESTADO CIVIL/Marital  Status </td>
            <td>
<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/> SOLTERO /Single<br />			
<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/> CASADO /Married<br />			
<input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/> DIVORCIADO/Divorced<br />
<input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/> VIUDO/ Widowed</td>
            <td>&nbsp;</td>
            <td>6.	FECHA DE NACIMIENTO/Date of Birth </td>
            <td><select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> - 
<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - 
<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select></td>
        </tr>
        <tr class="even">
            <td>7.	EDAD/Age</td>
            <td><input type="text" name="age" value="<?= @$info->age?>" /></td>
            <td>&nbsp;</td>
            <td>8.	LUGAR DE NACIMIENTO/Place of Birth</td>
            <td>PAIS/Country<input type="text" name="birth_country" value="<?= @$info->birth_country?>" /><br />
			 ESTADO  CIUDAD/Province<input type="text" name="birth_province" value="<?= @$info->birth_province?>" /><br />
			 CIUDAD/City<input type="text" name="birth_city" value="<?= @$info->birth_city?>" /></td>
        </tr>
        <tr class="odd">
            <td>9.	NUMERO DE CEDULA O CARNET DE IDENTIFICACION DE PAIS/Registration or Identification Card Number</td>
            <td><input type="text" name="national_id" value="<?= @$info->national_id?>" /></td>
			<td>&nbsp;</td>
			<td>10.	DIRECCION PARTICULAR/Home Address</td>
			<td><input type="text" name="home_address" value="<?= @$info->home_address?>" /></td>
        </tr>
        <tr class="even">
          <td>11.	TELEFONO/Phone</td>
		  <td><input type="text" name="tel" value="<?= @$info->tel?>" /></td>
		  <td>&nbsp;</td>
		  <td>12.	OCUPACION ACTUAL/Occupation</td>
		  <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
        </tr>
        <tr class="odd">
            <td>13.	NOMBRE Y DIRECCION DE SU EMPLEADOR/Name and address of present employer</td>
			<td colspan="4">
				<textarea name="employer"><?= @$info->employer?></textarea></td>
			</tr>
		
		 <tr class="even">
            <td>14.	 TELEFONOS/Telephone</td>
            <td><input type="text" name="employer_tel" value="<?= @$info->employer_tel?>" /></td>
			<td></td>
			<td></td>
			<td></td>
        </tr>
        <tr class="odd">
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		</tr>
        <tr class="even">
            <td colspan="5">DATOS DEL PASAPORTE / Passport Information:</td>
        </tr>
        <tr class="odd">
            <td>15.	NUMERO DEL PASAPORTE/Passport number</td>
            <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
            <td>&nbsp;</td>
            <td>LUGAR DE EXPEDICION/Place of Issue</td>
            <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
        </tr>
        <tr class="even">
            <td>17.	TIPO/Type</td>
            <td><input type="radio" name="travel_document_type" value="1" <?= (@$info->travel_document_type==1)?'checked':''?>/> ORDINARIO  / Ordinary  <br />
            <input type="radio" name="travel_document_type" value="2" <?= (@$info->travel_document_type==2)?'checked':''?>/> ASUNTOS PUBLICOS / Public Affairs <br />
            <input type="radio" name="travel_document_type" value="3" <?= (@$info->travel_document_type==3)?'checked':''?>/> OTRO / Other <br />
           
            INDIQUE  / Indicate<input type="text" name="travel_document_type_other" value="<?= @$info->travel_document_type_other?>" /></td>
            <td>&nbsp;</td>
            <td>18.	FECHA DE EXPEDICION/Date of issue</td>
            <td><input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
        </tr>
		        <tr class="odd">
            <td>19. FECHA DE VENCIMIENTO/Date of expiration </td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
			<td>&nbsp;</td>
			<td></td>
			<td></td>
        </tr>
        <tr class="even">
            <td colspan="5">INFORMACION DEL VIAJE / Travel Information:</td>
        </tr>		
        <tr class="odd">
            <td>20.	TIPO DE VIAJE/Type of trip</td>
			<td>
 <input type="radio" name="trip_type" value="1" <?= (@$info->trip_type==1)?'checked':''?>/> VISITA FAMILIAR / Family visit <br />
 <input type="radio" name="trip_type" value="2" <?= (@$info->trip_type==2)?'checked':''?>/> NEGOCIOS / Business<br />
 <input type="radio" name="trip_type" value="3" <?= (@$info->trip_type==3)?'checked':''?>/> TURISMO /  Tourism <br />
 <input type="radio" name="trip_type" value="4" <?= (@$info->trip_type==4)?'checked':''?>/> OTRO  / Other <br />
 INDIQUE / Indicate <input type="text" name="trip_type_other" value="<?= @$info->trip_type_other?>" /></td>
			<td>&nbsp;</td>
			<td>21.	TIEMPO QUE PERMANECERA EN VENEZUELA/Length of stay in Venezuela?</td>
			<td>
 <input type="radio" name="stay_days" value="1" <?= (@$info->stay_days==1)?'checked':''?>/> 1MES / 1 Month <br />
 <input type="radio" name="stay_days" value="2" <?= (@$info->stay_days==2)?'checked':''?>/> 3 MESES / 3 Month<br />
 <input type="radio" name="stay_days" value="3" <?= (@$info->stay_days==3)?'checked':''?>/> OTRO  /   Other <br />
 INDIQUE / Indicate <input type="text" name="stay_days_other" value="<?= @$info->stay_days_other?>" /></td>
        </tr>
        <tr class="even">
            <td>22.	TIENE FAMILIARES EN VENEZUELA?/Do you have relatives in Venezuela? </td>
            <td>
	<input type="radio" name="has_relatives" value="1" <?= (@$info->has_relatives==1)?'checked':''?>/> SI  / Yes 
    <input type="radio" name="has_relatives" value="0" <?= (@$info->has_relatives==0)?'checked':''?>/> NO / No<br />
 &nbsp;&nbsp;&nbsp;<input type="radio" name="relatives_type" value="1" <?= (@$info->relatives_type==1)?'checked':''?>/>  PADRES / Parents <br />
 &nbsp;&nbsp;&nbsp;<input type="radio" name="relatives_type" value="2" <?= (@$info->relatives_type==2)?'checked':''?>/> HIJOS  / Children <br />
 &nbsp;&nbsp;&nbsp;<input type="radio" name="relatives_type" value="3" <?= (@$info->relatives_type==3)?'checked':''?>/>  OTRO  /   Other <br />
 &nbsp;&nbsp;&nbsp;INDIQUE / Indicate <input type="text" name="relatives_type_other" value="<?= @$info->relatives_type_other?>" /> </td>
            <td>&nbsp;</td>
            <td>23.	CUANDO LOS VIO POR ULTIMA VEZ? /When did you see them last time ? </td>
            <td>
 <input type="radio" name="last_time" value="1" <?= (@$info->last_time==1)?'checked':''?>/> NUNCA / NEVER <br />
 <input type="radio" name="last_time" value="2" <?= (@$info->last_time==2)?'checked':''?>/> 1-2 ANOS / 1-2 YEARS<br />
 <input type="radio" name="last_time" value="3" <?= (@$info->last_time==3)?'checked':''?>/> 2-5 ANOS  / 2-5 YEARS <br />
 <input type="radio" name="last_time" value="2" <?= (@$info->last_time==4)?'checked':''?>/> 5-10 ANOS / 5-10 YEARS<br />
 <input type="radio" name="last_time" value="3" <?= (@$info->last_time==5)?'checked':''?>/> EN VENEZUELA  / IN VENEZUELA <br />
 <input type="radio" name="last_time" value="4" <?= (@$info->last_time==6)?'checked':''?>/> EN CHINA / IN CHINA </td>
        </tr>
        <tr class="odd">
            <td>24.	QUIEN ES RESPONSABLE ECONOMICAMENTE POR SU VIAJE (INCLUYENDO BOLETOS AEREOS)?/Who is responsible for your trip expenses (including air tickets)?</td>
			<td><input type="text" name="responsible" value="<?= @$info->responsible?>" /></td>
			<td>&nbsp;</td>
			<td>25.	DIRECCION/Address</td>
			<td><input type="text" name="responsible_address" value="<?= @$info->responsible_address?>" /></td>
        </tr>
        <tr class="even">
            <td>26.	TELEFONO/Phone</td>
            <td><input type="text" name="responsible_tel" value="<?= @$info->responsible_tel?>" /></td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
        </tr>
		
		<tr class="odd">
            <td>27. NOMBRE DE LA PERSONA,  COMPAÑIA U ORGANISMO OFICIAL A SER CONTACTADO EN VENEZUELA/Name of the person, company or institution to be contacted in Venezuela</td>
            <td colspan="4"><input type="text" name="contact" value="<?= @$info->contact?>" /></td>
        </tr>
        <tr class="even">
            <td>28. DIRECCION/Address </td>
            <td><input type="text" name="contact_address" value="<?= @$info->contact_address?>" /></td>
            <td>&nbsp;</td>
			<td>29. TELEFONO/Telephone </td>
			<td><input type="text" name="contact_tel" value="<?= @$info->contact_tel?>" /></td>
        </tr>

        <tr class="odd">
            <td>30. NOMBRE DE LA PERSONA, COMPAÑIA U ORGANISMO OFICIAL EN CHINA, QUE RESPALDA LA SOLICITUD DE VISA/Name of the person, company or institution in China supporting the visa application</td>
            <td colspan="4"><input type="text" name="support" value="<?= @$info->support?>" /></td>
        </tr>
		
		 <tr class="even">
            <td>31. DIRECCION/Address </td>
            <td><input type="text" name="support_address" value="<?= @$info->support_address?>" /></td>
            <td>&nbsp;</td>
			<td>32. TELEFONO/Telephone </td>
			<td><input type="text" name="support_tel" value="<?= @$info->support_tel?>" /></td>
        </tr>
		
        <tr class="odd">
            <td>33. FECHA DE ENTRADA A VENEZUELA/Arrival date at Venezuela</td>
            <td colspan="4"><input type="text" name="arrival_date" value="<?= @$info->arrival_date?>" id="arrival_date" /></td>
        </tr>
        <tr class="even">
            <td>34. LINEA AEREA/Airline</td>
            <td><input type="text" name="arrival_airline" value="<?= @$info->arrival_airline?>" /></td>
            <td>&nbsp;</td>
			<td>35. NUMERO DE VUELO/Flight number</td>
			<td><input type="text" name="arrival_flight_num" value="<?= @$info->arrival_flight_num?>" /></td>
        </tr>
        <tr class="odd">
            <td>36. FECHA DE SALIDA DE VENEZUELA/Departure date from Venezuela </td>
            <td colspan="4"><input type="text" name="depart_date" value="<?= @$info->depart_date?>" id="depart_date" /></td>
        </tr>
        <tr class="even">
             <td>37. LINEA AEREA/Airline</td>
             <td><input type="text" name="depart_airline" value="<?= @$info->depart_airline?>" /></td>
            <td>&nbsp;</td>
			<td>38. NUMERO DE VUELO/Flight number</td>
			<td><input type="text" name="depart_flight_num" value="<?= @$info->depart_flight_num?>" /></td>
        </tr>
        <tr class="odd">
            <td>39. HA SOLICITADO VISA VENEZOLANA ANTERIORMENTE?/Have you ever applied for a Venezuelan visa before?</td>
			<td>
 <input type="radio" name="is_applied" value="0" <?= (@$info->is_applied==0)?'checked':''?>/> NO  / No <br />
 <input type="radio" name="is_applied" value="1" <?= (@$info->is_applied==1)?'checked':''?>/> SI / Yes<br />
 <input type="radio" name="applied_result" value="1" <?= (@$info->applied_result==1)?'checked':''?>/> APROBADA / Approved <br />
 <input type="radio" name="applied_result" value="2" <?= (@$info->applied_result==2)?'checked':''?>/> RECHAZADA / Denied</td>
			<td>&nbsp;</td>
			<td>40. TIPO/Type</td>
			<td><input type="text" name="applied_type" value="<?= @$info->applied_type?>" /></td>
        </tr>
        <tr class="even">
            <td>41.HA VIAJADO A VENEZUELA ANTERIORMENTE?/Have you visited Venezuela before?</td>
			<td>
 <input type="radio" name="is_visited" value="0" <?= (@$info->is_visited==0)?'checked':''?>/> NO  / No <br />
 <input type="radio" name="is_visited" value="1" <?= (@$info->is_visited==1)?'checked':''?>/> SI / Yes</td>
			<td>&nbsp;</td>
			<td>42. FECHA DEL ULTIMO VIAJE/Date of last trip</td>
			<td><input type="text" name="last_trip_date" value="<?= @$info->last_trip_date?>" id="last_trip_date" /></td>
        </tr>
        <tr class="odd">
            <td>43.  DURACION DE LA ESTADIA EN EL PAIS/Length of stay in Venezuela</td>
			<td><input type="text" name="stay_length" value="<?= @$info->stay_length?>" /></td>
			<td>&nbsp;</td>
			<td>44. MOTIVO/Purpose</td>
			<td><input type="text" name="stay_purpose" value="<?= @$info->stay_purpose?>" /></td>
        </tr>
        <tr class="even">
            <td>45. INDIQUE AL MENOS TRES RAZONES QUE JUSTIFIQUEN SU VIAJE/ Give at least three reasons to justify your trip</td>
            <td colspan="4"><textarea name="reasons"><?= @$info->reasons?></textarea></td>
        </tr>
        <tr class="odd">
             <td>46. INFORMACION ADICIONAL QUE DESEE SUMINISTRAR/  Additional Information you wish to give us</td>
            <td colspan="4"><textarea name="infos"><?= @$info->infos?></textarea></td>
        </tr>
        <tr class="even">
           <td></td>
		   <td></td>
		   <td>&nbsp;</td>
		   <td></td>
		   <td></td>
        </tr>
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		nationality:"required",
		sex:"required",
		marital_status:"required",
		national_id:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_type:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required",
		trip_type:"required",
		stay_days:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#arrival_date").datepicker();
	$("#depart_date").datepicker();
	$("#last_trip_date").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>